<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        
        <script type="text/javascript">
            var arr = [3,4,5,23,true,false];
            /* for循环遍历数组 */
            for(var i = 0;i < arr.length; i ++){
                console.log(arr[i]);
            }

            /* foreach循环遍历数组
                语法为for(var i in arr),并且i是索引不是元素
            */
            for(var i in arr){
                console.log(arr[i])
            }

        </script>
    </head>
    <body>

    </body>
</html>